<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>张三的成绩</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="grade">
    <p>请输入张三的成绩：
        <input type="text" @keyup.enter="handleClick" v-model='score'>
    </p>
    <h2>{{result}}</h2>
    </div>

    <script>
        var vm = new Vue({
            el:"#grade",
            data:{
                result:'',
                score:''
            },
            methods:{
                handleClick(){ 
                if(this.score<0 || this.score>100){
                    this.result="请输入正确的成绩"
                }else if(this.score>=90){
                    this.result="张三的成绩优秀"
                }else if(this.score>=75){
                    this.result="张三的成绩良好"
                }else if(this.score>=60){
                    this.result="张三的成绩合格"
                }else{
                    this.result="张三的成绩不合格"
                }
                }
            }
        })
    </script>
</body>
</html>